<!DOCTYPE html>
<html>
<head>
<style type="text/css">
 div > * {
     display: block;
 }
</style>
</head>
<body>
<div id="test" contenteditable><hr><datagrid></datagrid><object></object></div>
<script src="../../resources/dump-as-markup.js"></script>
<script>

var test = document.getElementById('test');
test.focus();

Markup.description('This test ensures WebKit does not ignore the content of hr, datagrid, and object with child nodes.')

var text = 'hello world WebKit';

for (var i = 0; i < test.childNodes.length; i++) {
    var textNode = document.createTextNode(text);
    test.childNodes[i].appendChild(textNode);
    // OBJECT fallback content rendering is asynchronous.
    if (window.internals)
        internals.updateLayoutAndRunPostLayoutTasks();
    window.getSelection().setBaseAndExtent(textNode, 6, textNode, 11);
    document.execCommand('bold', false, null);
}

Markup.dump(test, '"world" and only "world" should be bolded in each element below');

window.getSelection().setBaseAndExtent(test, 0, test, 3);

var range = window.getSelection().getRangeAt(0).cloneContents();

Markup.dump(range, 'The result below should be identical to the result above');

</script>
</body>
</html>
